<!DOCTYPE html>
<!-- 
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.0
Version: 1.5
Author: KeenThemes
Website: http://www.keenthemes.com/
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
-->
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
   <meta charset="utf-8" />
   <title>药店进销存管理系统 | 采购单据</title>
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta content="width=device-width, initial-scale=1.0" name="viewport" />
   <meta content="" name="description" />
   <meta content="" name="author" />
   <meta name="MobileOptimized" content="320">
   <!-- BEGIN GLOBAL MANDATORY STYLES -->          
   <link href="${base}/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
   <!-- END GLOBAL MANDATORY STYLES -->
   <!-- BEGIN PAGE LEVEL STYLES -->
   <link rel="stylesheet" type="text/css" href="${base}/assets/plugins/select2/select2_metro.css" />
   <link rel="stylesheet" href="${base}/assets/plugins/data-tables/DT_bootstrap.css" />
   <!-- END PAGE LEVEL STYLES -->
   <!-- BEGIN THEME STYLES --> 
   <link href="${base}/assets/css/style-metronic.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/css/style.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/css/style-responsive.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/css/plugins.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/css/themes/default.css" rel="stylesheet" type="text/css" id="style_color"/>
   <link href="${base}/assets/css/custom.css" rel="stylesheet" type="text/css"/>
   <!-- END THEME STYLES -->
   <link rel="shortcut icon" href="${base}/assets/img/favicon.ico" />
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
   <#include "header.ftl">
   <div class="clearfix"></div>
   <!-- BEGIN CONTAINER -->
   <div class="page-container">
      <!-- BEGIN SIDEBAR -->
      <div class="page-sidebar navbar-collapse collapse">
         <!-- BEGIN SIDEBAR MENU -->        
         <ul class="page-sidebar-menu">
            <li>
               <!-- BEGIN SIDEBAR TOGGLER BUTTON -->
               <div class="sidebar-toggler hidden-phone"></div>
               <!-- BEGIN SIDEBAR TOGGLER BUTTON -->
            </li>
            <li class="start">
		       <a href="${base}/admin/admin!main.action">
		       <i class="icon-home"></i> 
		       <span class="title">首页</span>
		       </a>
		    </li>
		    <li class="">
		       <a href="javascript:;">
		       <i class="icon-cogs"></i> 
		       <span class="title">业务中心</span>
		       <span class="arrow "></span>
		       </a>
		       <ul class="sub-menu">
		          <li >
		             <a href="${base}/admin/admin!cashiering.action">
		             	消费收银</a>
		          </li>
		       </ul>
		    </li>
		    <li>
		       <a href="javascript:;">
		       <i class="icon-bookmark-empty"></i> 
		       <span class="title">会员管理</span>
		       <span class="arrow "></span>
		       </a>
		       <ul class="sub-menu">
		          <li >
		             <a href="${base}/admin/member!checkin.action">
		             	会员登记</a>
		          </li>
		          <li >
		             <a href="#memberInfo"  data-toggle="modal">
		             	会员信息</a>
		          </li>
		          <li >
		             <a href="${base}/admin/member!memberLevel.action">
		             	会员级别</a>
		          </li>
		          <li>
		             <a href="${base}/admin/member!memberList.action">
		             	会员列表</a>
		          </li>
		       </ul>
		    </li>
		    <li class="">
		       <a href="javascript:;">
		       <i class="icon-table"></i> 
		       <span class="title">库存管理</span>
		       <span class="arrow "></span>
		       </a>
		       <ul class="sub-menu">
		          <li >
		             <a href="${base}/admin/admin!purchase.action">
		             	采购进货</a>
		          </li>
		          <li >
		             <a href="${base}/admin/admin!refund.action">
		             	退货换货</a>
		          </li>
		          <li >
		             <a href="${base}/admin/inventory!list.action">
		             	库存盘点</a>
		          </li>
		       </ul>
		    </li>
		    <li class="">
		       <a href="javascript:;">
		       <i class="icon-sitemap"></i> 
		       <span class="title">供应商管理</span>
		       <span class="arrow "></span>
		       </a>
		       <ul class="sub-menu">
		          <li >
		             <a href="${base}/admin/supplier!add.action">供应商录入</a>
		          </li>
		          <li class = "">
		             <a href="${base}/admin/supplier!list.action">供应商列表</a>
		          </li>
		       </ul>
		    </li>
		    <li class="">
		       <a href="javascript:;">
		       <i class="icon-gift"></i> 
		       <span class="title">药品管理</span>
		       <span class="arrow "></span>
		       </a>
		       <ul class="sub-menu">
		          <li >
		             <a href="${base}/admin/medicine!add.action">药品录入</a>
		          </li>
		          <li >
		             <a href="${base}/admin/medicine!list.action">药品列表</a>
		          </li>
		       </ul>
		    </li>
		    <li class="">
		       <a href="javascript:;">
		       <i class="icon-user"></i> 
		       <span class="title">用户管理</span>
		       <span class="arrow "></span>
		       </a>
		       <ul class="sub-menu">
		          <li >
		             <a href="${base}/admin/user!add.action">
		             	用户录入</a>
		          </li>
		          <li >
		             <a href="${base}/admin/user!list.action">
		             
		             	用户列表</a>
		          </li>
		       </ul>
		    </li>
		    <li class = "active">
		       <a href="javascript:;">
		       <i class="icon-user"></i> 
		       <span class="title">单据管理</span>
		       <span class="selected "></span>
		       </a>
		       <ul class="sub-menu">
		          <li>
		             <a href="${base}/admin/admin!sellerRecordList.action">消费单据</a>
		          </li>
		          <li class="active">
		             <a href="${base}/admin/admin!purchaseList.action">采购单据</a>
		          </li>
		          <li >
		             <a href="${base}/admin/admin!refundList.action">退货单据</a>
		          </li>
		       </ul>
		    </li>
		    <!-- 会员信息弹出框开始 -->
		    <#include "memberInfoDialog.ftl">
		    <!-- 会员信息弹出框结束  -->
         </ul>
         <!-- END SIDEBAR MENU -->
      </div>
      <!-- END SIDEBAR -->
      <!-- BEGIN PAGE -->
      <div class="page-content">
      	<#include "changePassword.ftl">
         <#include "system-set.ftl">
         <!-- 消费记录开始-->
         <div class="modal" id="purchaseDetail" tabindex="-1" role="dialog" data-backdrop="static" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog modal-wide">
               <div class="modal-content">
                  <div class="modal-header">
                     <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                     <h4 class="modal-title">采购明细</h4>
                  </div>
                  <div class="modal-body">
                     	<table class="table table-striped table-bordered table-hover" id="DanJu_cg">
                        <thead>
                           <tr>
                              <th class="hidden-480">药品编码</th>
                              <th class="hidden-480">药品名称</th>
                              <th class="hidden-480">进货店面</th>
                              <th class="hidden-480">批次码</th>
                              <th class="hidden-480">进货价格</th>
                              <th class="hidden-480">进货数量</th>
                              <th class="hidden-480">供应商</th>
                              <th class="hidden-480">备注</th>
                           </tr>
                        </thead>
                        <tbody>
                        </tbody>
                     </table>
                  </div>
                  <div class="modal-footer">
                     <button type="button" class="btn default" data-dismiss="modal">关闭</button>
                  </div>
               </div>
               <!-- /.modal-content -->
            </div>
            <!-- /.modal-dialog -->
         </div>
         <!-- 消费记录结束-->
         <!-- BEGIN PAGE HEADER-->
         <div class="row">
            <div class="col-md-12">
               <!-- BEGIN PAGE TITLE & BREADCRUMB-->
               <h3 class="page-title">
                  	采购单据 <small>这里列出了系统中所有药品的采购单据，你可以点击采购单据号查询采购明细。</small>
               </h3>
               <ul class="page-breadcrumb breadcrumb">
                  <li>
                     <i class="icon-home"></i>
                     <a href="${base}/admin/admin!main.action">Home</a> 
                     <i class="icon-angle-right"></i>
                  </li>
                  <li>
                     <a href="#">单据管理</a>
                     <i class="icon-angle-right"></i>
                  </li>
                  <li><a href="#">采购单据</a></li>
               </ul>
               <!-- END PAGE TITLE & BREADCRUMB-->
            </div>
         </div>
         <!-- END PAGE HEADER-->
         <!-- BEGIN PAGE CONTENT-->
         <div class="row">
            <div class="col-md-12">
               <!-- BEGIN EXAMPLE TABLE PORTLET-->
               <div class="portlet box blue">
                  <div class="portlet-title">
                     <div class="caption"><i class="icon-globe"></i>采购单据</div>
                     <div class="tools">
                        <a href="javascript:;" class="collapse"></a>
                        <a href="javascript:;" class="reload"></a>
                        <a href="javascript:;" class="remove"></a>
                     </div>
                  </div>
                  <div class="portlet-body">
                     <table class="table table-striped table-bordered table-hover" id="purchase-danju">
                        <thead>
                           <tr>
                              <th style="width:18px;">采购单据号</th>
                              <th class="hidden-480">采购日期</th>
                              <th class="hidden-480">创建人</th>
                           </tr>
                        </thead>
                        <tbody>
                        	<#if purchaseList?exists>
	                        	<#list purchaseList as purchase>
		                           <tr class="odd gradeX">
		                              <td class="hidden-480">
		                              	<#if purchase.djh?exists>
		                              		<a href = "javascript:;" onclick = "return detail(this);" style = "cursor:pointer;">${purchase.djh}</a></#if>
		                              	</td>
		                              <td class="hidden-480"><#if purchase.date?exists>${purchase.date}</#if></td>
		                              <td class="hidden-480"><#if purchase.handlername?exists>${purchase.handlername}</#if></td>
		                           </tr>
	                           </#list>
                           </#if>
                        </tbody>
                     </table>
                  </div>
               </div>
               <!-- END EXAMPLE TABLE PORTLET-->
            </div>
         </div>
         <!-- END PAGE CONTENT-->
      </div>
      <!-- END PAGE -->
   </div>
   <!-- END CONTAINER -->
   <!-- BEGIN FOOTER -->
   <div class="footer">
      <div class="footer-inner">
        2014 &copy; 西南财经大学天府学院  | 袁金廷
      </div>
      <div class="footer-tools">
         <span class="go-top">
         <i class="icon-angle-up"></i>
         </span>
      </div>
   </div>
   <!-- END FOOTER -->
   <!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
   <!-- BEGIN CORE PLUGINS -->   
   <!--[if lt IE 9]>
   <script src="${base}/assets/plugins/respond.min.js"></script>
   <script src="${base}/assets/plugins/excanvas.min.js"></script> 
   <![endif]-->   
   <script src="${base}/assets/plugins/jquery-1.10.2.min.js" type="text/javascript"></script>
   <script src="${base}/assets/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>    
   <script src="${base}/assets/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
   <script src="${base}/assets/plugins/bootstrap-hover-dropdown/twitter-bootstrap-hover-dropdown.min.js" type="text/javascript" ></script>
   <script src="${base}/assets/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
   <script src="${base}/assets/plugins/jquery.blockui.min.js" type="text/javascript"></script>  
   <script src="${base}/assets/plugins/jquery.cookie.min.js" type="text/javascript"></script>
   <script src="${base}/assets/plugins/uniform/jquery.uniform.min.js" type="text/javascript" ></script>
   <!-- END CORE PLUGINS -->
   <!-- BEGIN PAGE LEVEL PLUGINS -->
   <script type="text/javascript" src="${base}/assets/plugins/select2/select2.min.js"></script>
   <script type="text/javascript" src="${base}/assets/plugins/data-tables/jquery.dataTables.js"></script>
   <script type="text/javascript" src="${base}/assets/plugins/data-tables/DT_bootstrap.js"></script>
   <!-- END PAGE LEVEL PLUGINS -->
   <!-- BEGIN PAGE LEVEL SCRIPTS -->
   <script src="${base}/assets/scripts/app.js"></script>
   <script src="${base}/resources/scripts/purchase-danju-managed.js"></script>
   <script>
      jQuery(document).ready(function() {       
         App.init();
         SellerrecordManaged.init();
      });
      function detail(djh){
     		$("#table_purchaseDetail tbody tr").remove();
	     	$.ajax({
	            type:"post",
	            url:"/pims/admin/admin!findDetailByCgdjh.action",
	            dataType:"json",
	            data:"djh="+$(djh).html(),
	            cache:false,
	            beforeSend:function(XMLHttpRequest){
	            },
	            success:function(json){
	            	jhDetailList = json.jhDetailList;
	            	if(jhDetailList == ""){
	            	}else{
		            	$(jhDetailList).each(function(i){
		            		 $( "#table_purchaseDetail tbody" ).append( "<tr>" +
					              "<td>" + jhDetailList[i].ypbm + "</td>" +
					              '<td>' + jhDetailList[i].ypmc + "</td>" +
					              '<td>' + jhDetailList[i].jhdm + "</td>" +
					              '<td>' + jhDetailList[i].pcm + "</td>" +
					              '<td>' + jhDetailList[i].jhjg + "</td>" +
					              '<td>' + jhDetailList[i].jhsl + "</td>" +
					              '<td>' + jhDetailList[i].gys + "</td>" +
					              '<td>' + jhDetailList[i].bz + "</td>" +
					            "</tr>" );
		            	});
		            }
		            $("#purchaseDetail").modal("show");
	            },
	           	complete:function(XMLHttpRequest,textStatus){
	           	},
	          	error:function(XMLHttpRequest,textStatus,errorThrown){
	                   alert("网络错误");
	          	}
	        });
     	}
   </script>
</body>
<!-- END BODY -->
</html>